import request from '@/utils/request'
// 司法组织机构-被申请人 API接口
const di_rel_dept_targetApi = {
    list: '/di_rel_dept_target/list',
    save: '/di_rel_dept_target/save',
    view: '/di_rel_dept_target/view',
    del: '/di_rel_dept_target/delete',
    dels: '/di_rel_dept_target/batchDel',
    output: '/di_rel_dept_target/output',
    exportExcelTemplate: '/di_rel_dept_target/exportExcelTemplate',
    importExcel: '/di_rel_dept_target/importExcel',
    queryAllTargetOrg: '/queryAllTargetOrg'
}

/**
 * 导入司法组织机构-被申请人Excel
 */
export function importExcel (data) {
  var body = new FormData()
  body.append('file', data)
  return request({
    url: di_rel_dept_targetApi.importExcel,
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data: body
  })
}

/**
 * 导出司法组织机构-被申请人Excel模板
 */
export function exportExcelTemplate () {
    return request({
        url: di_rel_dept_targetApi.exportExcelTemplate,
        method: 'post',
        responseType: 'blob'
    })
}

/**
 * 导出司法组织机构-被申请人
 */
export function output (data) {
    return request({
        url: di_rel_dept_targetApi.output,
        method: 'post',
        data: data,
        responseType: 'blob'
    })
}
/**
 * 批量删除司法组织机构-被申请人
 * @param {*} ids
 */
export function delDi_rel_dept_targets (ids) {
    return request({
        url: di_rel_dept_targetApi.dels,
        method: 'post',
        params: { ids }
    })
}
/**
 * 删除司法组织机构-被申请人
 * @param {*} id
 */
export function delDi_rel_dept_target (id) {
    return request({
        url: di_rel_dept_targetApi.del,
        method: 'post',
        params: { id }
    })
}
/**
 * 查看、编辑司法组织机构-被申请人
 * @param {*} id
 */
export function viewDi_rel_dept_target (id) {
    return request({
        url: di_rel_dept_targetApi.view,
        method: 'get',
        params: { id }
    })
}
/**
 * 保存司法组织机构-被申请人
 * @param {*} body
 */
export function saveDi_rel_dept_target (body) {
    return request({
        url: di_rel_dept_targetApi.save,
        method: 'post',
        data: body
    })
}
/**
 * 查询司法组织机构-被申请人列表
 * @param {*} body
 */
export function queryDi_rel_dept_targetList (body) {
    return request({
        url: di_rel_dept_targetApi.list,
        method: 'post',
        data: body
    })
}
/**
 * 获取被申请人组织信息
 */
export function queryAllTargetOrg () {
    return request({
        url: di_rel_dept_targetApi.queryAllTargetOrg,
        method: 'get'
    })
}
